<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link rel="stylesheet" href="../lib/bootstrap-3.3.5-dist/css/bootstrap.min.css">
  <script src='../lib/bootstrap-3.3.5-dist/js/jquery-3.6.0.js'></script>
  <script src='../lib/bootstrap-3.3.5-dist/js/bootstrap.min.js'></script>
  <script src='../javascript/data.js'></script>
  <script src="../javascript/flgl.js"></script>
  <link rel="stylesheet" href="../css/flgl.css">
  <title>Document</title>
</head>

<body>
  1234567890-
  <div id="menu" class="clear">
    <div id='anniu'>
      <button class="chakan">查看分类</button>
      <button class="tianjia">添加分类</button>
    </div>
    <div class="menu_table">
      <table class="table table-striped " id="mytable" border="">
        <thead>
          <tr>
            <th>分类编号</th>
            <th>分类名称</th>
            <th>分类描述</th>
            <th>备注</th>
            <th>编辑</th>
            <th>删除</th>
          </tr>
        </thead>
        <tbody id="tbody">

        </tbody>
      </table>
    </div>
    <div class="menu_fenlei">
      <div class="clear">
        <span>分类名称</span>
        <input type="text" placeholder="分类名称">
        <p>10字以内…</p>
      </div>
      <div class="clear">
        <span>备注</span>
        <textarea name="" id="" cols="50" rows="6" placeholder="输入备注"></textarea>
        <p>250字以内…</p>
      </div>
      <button class="menu_btn">添加分类</button>
    </div>
    
    <nav aria-label="Page navigation" id="yema">
      <ul class="pagination">
        <li id="pre" onclick="prePage()">
          <a href="#" aria-label="Previous">
            <span aria-hidden="true">&laquo;</span>
          </a>
        </li>
        <li class="page"><a href="#">1</a></li>
        <li class="page"><a href="#">2</a></li>
        <li class="page"><a href="#">3</a></li>
        <li class="page"><a href="#">4</a></li>
        <li class="page"><a href="#">5</a></li>
        <li id="next">
          <a href="#" aria-label="Next">
            <span aria-hidden="true">&raquo;</span>
          </a>
        </li>
      </ul>
    </nav>
  </div>
    <script>
      let maxPage
      let fenyeData = allData
      let dangqianye = 1
      // 渲染数据
      // showTable(allData)
      // 进行分页
      function fenye(num, data) {
        let qishi = (num - 1) * 10
        let str = data.slice(qishi, qishi + 10)
        showTable(str)
      }
      fenye(1, allData)
      $('#yema').on('click','.page',function(e){
       parseInt($(this).atrr('data-page'))
       console.log(this)
      let num=parseInt($(this).attr('.page'))
      })
      showTable(allData)

    </script>
</body>

</html>